import requests

# # 请求淘宝
# taobao_url = "https://www.taobao.com/"
# # 用requests请求淘宝
# taobao_rep = requests.get(url=taobao_url)
# print(taobao_rep)
# print(taobao_rep.text)

# 请求获取企业微信token的接口
corpid = "ww32f5df9a2517b554"
corpsecret = "nuNw29ZfaeuyYVhV1qrckKSn12Z7Lmntp3whCMbJF1w"
# # 请求参数放到url中
# token_url = f"https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid={corpid}&corpsecret={corpsecret}"
# token_rep = requests.get(url=token_url)

# 请求参数通过参数传入
token_url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken"
my_params = {
    "corpid": corpid,
    "corpsecret": corpsecret
}
token_rep = requests.get(url=token_url, params=my_params)
# 获取返回的json格式数据
token_rep_json = token_rep.json()
token = token_rep_json.get("access_token")
print(token)

# # 网易见外工作台搜索接口
# wy_url = "https://nmtp.youdao.com/api/organize/1514708/articles?articleType=-1&keywords=71&orderType=0&page=1&pageSize=20"
# my_headers = {
#     "Cookie": """_ga=GA1.2.465781817.1655621565; OUTFOX_SEARCH_USER_ID_NCOO=298335832.6827876; OUTFOX_SEARCH_USER_ID="-1928168192@10.108.162.139"; _gid=GA1.2.887797372.1683464218; _gat=1; SESSION=e2d1a5e9-383c-45e5-8fec-93751cca6ff7; NTES_SESS=L7_cBaqbgUW3dx3NPAfqk3gDzNhOL2MBs1JzS0uASPUQd3GbdnHABweRPIC5ySkrNXcPF1WNeStnjOsCWjBRaMpgpq4ExFuFUwouMBULf2RSJPjbNEXRu_uEYau.6wtqakUPaS0K91GOBK8QmDvfw7mxgBPCMiSZ4W8mUfk_f9akK6s..AmsKDWd.zL4JmS8PWWHe0LNAd6XFEuh2H1jyJxjK; S_INFO=1683464233|0|##|974381044@qq.com; P_INFO=974381044@qq.com|1683464233|0|youdao_jianwai|00&99|sic&1681733877&youdao_jianwai#sic&510100#10#0#0|&0||974381044@qq.com"""
# }
# wy_rep = requests.get(url=wy_url, headers=my_headers)
# print(wy_rep.json())